<?php

namespace app\admin\model;

use think\Model;


class Area extends Model
{

    

    

    // 表名
    protected $name = 'area';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];



    public function getFullName()
    {
        $names = [];
        $current = $this;
        while ($current) {
            array_unshift($names, $current['name']);
            $current = self::get($current['pid']);
        }
        return implode('/', $names);
    }





}
